package com.geoway.adf.report.service.impl;

import com.geoway.adf.report.dao.WorkBookDao;
import com.geoway.adf.report.po.WorkBookPO;
import com.geoway.adf.report.service.WorkBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Optional;

/**
 * @Author: lzw
 * @Date: 2024/1/22 11:07
 * @Description:
 */
@Service
public class WorkBookServiceImpl implements WorkBookService {
    @Autowired
    private WorkBookDao workBookDao;

    @Override
    public Optional<WorkBookPO> findById(String id) {
        return workBookDao.findById(id);
    }

    @Override
    public WorkBookPO save(WorkBookPO po) {
        //WorkBook不保存实际数据，具体Sheet数据请用SheetService保存
        po.getWorkBook().setData(new ArrayList<>());
        return workBookDao.save(po);
    }
}
